<!DOCTYPE composition PUBLIC "-//W3C//DTD XHTML 1.0 Transitional//EN" 
	"http://www.w3.org/TR/xhtml1/DTD/xhtml1-transitional.dtd">
<ui:composition xmlns="http://www.w3.org/1999/xhtml"
	xmlns:s="http://jboss.com/products/seam/taglib"
	xmlns:ui="http://java.sun.com/jsf/facelets"
	xmlns:f="http://java.sun.com/jsf/core"
	xmlns:h="http://java.sun.com/jsf/html"
	xmlns:rich="http://richfaces.org/rich"
	template="/layout/template.xhtml">

	<ui:define name="content">

		<h1>Workspaces</h1>

		<h:form id="workspaces">
			<rich:panel>
				<f:facet name="header">Select a workspace to resume</f:facet>
					<h:outputText value="The are no active (named) workspaces." rendered="#{empty conversationList}"/>
					<rich:dataTable value="#{conversationList}" var="_entry" rendered="#{not empty conversationList}">
						<h:column>
							<f:facet name="header">Id</f:facet>
							#{_entry.id}
						</h:column>
						<rich:column style="text-align: center;">
							<f:facet name="header">Is nested?</f:facet>
							#{_entry.nested ? 'yes' : 'no'}
						</rich:column>
						<h:column>
							<f:facet name="header">Current page</f:facet>
							<h:commandLink action="#{_entry.select}" value="#{_entry.description}"
								rendered="#{not _entry.current}"/>
							<h:outputText value="#{_entry.description}"
								rendered="#{_entry.current}"/>
						</h:column>
						<h:column>
							<f:facet name="header">Last used</f:facet>
							<h:outputText value="#{_entry.lastDatetime}"
								rendered="#{not _entry.current}">
								<s:convertDateTime type="time" pattern="hh:mm a"/>
							</h:outputText>
							<h:outputText value="current" rendered="#{_entry.current}"/>
						</h:column>
						<rich:column styleClass="action">
							<f:facet name="header">Action</f:facet>
							<h:commandLink action="#{_entry.select}" value="Resume"
								rendered="#{not _entry.current}"/>
							#{not _entry.current ? ' ' : ''}
							<h:commandLink action="#{_entry.destroy}" value="Destroy"/>
						</rich:column>
					</rich:dataTable>
			</rich:panel>
		</h:form>

	</ui:define> 
</ui:composition>
